home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / tcp_ip / tnos / tnos100s / netuser.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-24  |  1.6 KB  |  61 lines

  1. /* Mods by G1EMM */
  2. #ifndef    _NETUSER_H
  3. #define    _NETUSER_H
  4.  
  5. /* Global structures and constants needed by an Internet user process */
  6.  
  7. #ifndef    _GLOBAL_H
  8. #include "global.h"
  9. #endif
  10.  
  11. #define    NCONN    20        /* Maximum number of open network connections */
  12.  
  13. extern int32 Ip_addr;    /* Our IP address */
  14. extern int Net_error;    /* Error return code */
  15. #define    NONE        0    /* No error */
  16. #define    CON_EXISTS    1    /* Connection already exists */
  17. #define    NO_CONN        2    /* Connection does not exist */
  18. #define    CON_CLOS    3    /* Connection closing */
  19. #define    NO_MEM        4    /* No memory for TCB creation */
  20. #define    WOULDBLK    5    /* Would block */
  21. #define    NOPROTO        6    /* Protocol or mode not supported */
  22. #define    INVALID        7    /* Invalid arguments */
  23.  
  24. #ifndef TNOS_68K
  25. #define    INET_EOL    "\r\n"    /* Standard Internet end-of-line sequence */
  26. #else
  27. #define    INET_EOL    "\r\l"    /* Standard Internet end-of-line sequence */
  28. #endif
  29.  
  30. /* Codes for the tcp_open call */
  31. #define    TCP_PASSIVE    0
  32. #define    TCP_ACTIVE    1
  33. #define    TCP_SERVER    2    /* Passive, clone on opening */
  34.  
  35. /* Local IP wildcard address */
  36. #define    INADDR_ANY    0x0L
  37.  
  38. /* Socket structure */
  39. struct socket {
  40.     int32 address;        /* IP address */
  41.     int16 port;        /* port number */
  42. };
  43. #define    NULLSOCK    (struct socket *)0
  44.  
  45. /* Connection structure (two sockets) */
  46. struct connection {
  47.     struct socket local;
  48.     struct socket remote;
  49. };
  50. /* In domain.c: */
  51. int32 resolve __ARGS((char *name));
  52. int32 resolve_mx __ARGS((char *name));
  53.  
  54. /* In netuser.c: */
  55. int32 aton __ARGS((char *s));
  56. char *inet_ntoa __ARGS((int32 a));
  57. char *pinet __ARGS((struct socket *s));
  58. char *inet_ntobos __ARGS((int32 a));
  59.  
  60. #endif    /* _NETUSER_H */
  61.